package com.mao.mapper;

import com.mao.pojo.User;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

public class UserMapperImpl implements UserMapper{
    //我们的所有操作都使用SQL session 现在使用SQL sessiontemplate
    private SqlSessionTemplate sqlSession;


    @Override
    public List<User> selectUser() {
        UserMapper mapper= sqlSession.getMapper(UserMapper.class);
        return mapper.selectUser();
    }

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession=sqlSession;
    }
}
